<?php
/**
 * Created by PhpStorm.
 * User: apple
 * Date: 2018/11/29
 * Time: 2:10 PM
 */

namespace app\purchase\model;

/**
 * Class Brand
 * @package app\purchase\model
 * @OA\Schema(
 *   type="object",
 *   description="品牌模型",
 *   @OA\Property(
 *     property="brand_id",
 *     description="品牌ID",
 *     type="integer",
 *   ),
 *   @OA\Property(
 *     property="brand_name",
 *     description="品牌名称",
 *     type="string",
 *   ),
 *   @OA\Property(
 *     property="brand_logo",
 *     description="品牌Logo",
 *     type="string",
 *   ),
 * )
 */
class Brand extends \ShopModel
{
    protected $table = 'sh_brand';

    protected $pk = 'brand_id';


    public function getBrandLogoAttr($brandLogo)
    {
        return BRAND_LOGO_URL . $brandLogo;
    }

    public function setBrandLogoAttr($brandLogo)
    {
        return str_replace(BRAND_LOGO_URL, '', $brandLogo);
    }
}